package org.test.java;

import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liangcai_zhu
 * @Description TODO
 * @Date 2019/10/6 11:02
 */
public class MySource {

    @Test
    public void testMap() {
        Map map = new HashMap();
        System.out.println(map);
//        psql -f v7pg.sql "dbname=v7pg user=jdy password=Jdy#2019 host=172.17.53.31 options=--search_path=yjbtestpg4"

        testFormat("/xxxx/", "v7pg.sql", "172.17.53.31", "5433","jdy","Jdy#2019","yjbtestpg4","v7pg");
    }

    private void testFormat(String localFilePath, String fileName, String hostIp,String port,
                            String userName,
                            String password, String schema, String dbName) {
        String str = null;
        str = String.format("psql -f %s \"dbname=%s user=%s password=%s host=%s port=%s options=--search_path=%s\"",
                localFilePath+fileName,dbName,userName,password,hostIp,port,schema);
        System.out.println(str);
    }

}
